package vumt.radiocountries.util;

import android.content.Context;
import android.net.ConnectivityManager;

/**
 * @author Hanh
 *
 */
/**
 * @author Hanh
 * 
 */
public class NetWorkUtils {
	/**
	 * Kiểm tra kết nối internet
	 * 
	 * @param context
	 * @return
	 */
	public static boolean isNetworkConnected(Context context) {
		ConnectivityManager cm = (ConnectivityManager) context
				.getSystemService(Context.CONNECTIVITY_SERVICE);
		return (cm.getActiveNetworkInfo() != null
				&& cm.getActiveNetworkInfo().isAvailable() && cm
				.getActiveNetworkInfo().isConnected());
	}
}
